﻿/***********************/
/* (c) Alexandru Lungu */
/*  Challenge is Life! */
/* www.challenge-me.ws */
/***********************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Coowork.WcfCommon;
using System.Security.Permissions;

namespace Coowork.WcfServer
{
    public class ExampleService : IExampleService
    {
        ServerInfo info = new ServerInfo();

        public ExampleService()
        {

        }

        public ServerInfo GetServerInfo()
        {
            return info;
        }
       
        [PrincipalPermission(SecurityAction.Demand, Role = "Admin")]
        public int Sum(int a, int b)
        {
            return a + b;
        }

        public string MultiplyText(string text, int no)
        {
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < no; i++)
            {
                sb.Append(text);
            }
            return sb.ToString();
        }

    }
}
